import cardplayer


class Dealer(cardplayer.Player):

    def __init__(self):
        super(Dealer, self).__init__("Dealer")
        self._down_card = None

    def display_hand(self):
        print "\n"
        print self.name
        hand = self.hands[0]
        for i in range(len(hand._cards)):
            if i == 0:
                print "DOWN CARD"
            else:
                hand._cards[i].display()

    def display_full_hand(self):
        print "\n"
        print self.name
        self._current_hand.display_hand()

    def hit(self, card):
        card.display()
        self._current_hand.deal_card(card)
        if self._current_hand.total == 21:
            self._21 = True
        if self._current_hand.total > 21:
            self._bust = True
            print "BUST!"

        if self._current_hand.total <= 16:
            return True
        else:
            return False
